<div class="container">
    
    <?php echo validation_errors("<div class='alert alert-danger'>", "</div>"); ?>
    <form class="form-inline" method="post">
        <div class="form-horizontal">

            <div class="control-group">
                <label class="control-label">#</label>
                <div class="controls"><?=$item['iditemsconsulta']?></div>
            </div>

            <div class="control-group">
                <label class="control-label">Cantidad</label>
                <div class="controls">
                    <input id="cantidad" name="cantidad" type="text" class="span2 input-block-level" value="<?=$item['cantidad']?>">
                </div>
            </div>

            <div class="control-group">
                <label class="control-label">Artículo</label>
                <div class="controls">
                    <select name="articulo" class="chosen">
                        <?php foreach($articulos as $articulo) { ?>
                        <option value="<?=$articulo['idArticulo']?>" <?= ($articulo['idArticulo'] == $item['idarticulo'])?"selected":"" ?>><?=$articulo['producto']['nombre'].' '.$articulo['codigo']?></option>
                        <?php } ?>
                    </select>
                </div>
            </div>

            <div class="control-group">
                <label class="control-label">Precio</label>
                <div class="controls">
                    <input name="precio" type="text" class="span2 input-block-level" value="<?=$item['precio']?>">
                </div>
            </div>

            <div class="control-group">
                <label class="control-label">Entrega</label>
                <div class="controls">
                    <input name="entrega" type="text" class="span2 input-block-level" value="<?=$item['entrega']?>">
                </div>
            </div>

            <div class="control-group">
                <label class="control-label">Observaciones</label>
                <div class="controls">
                    <textarea name="observaciones"><?=$item['observaciones']?></textarea>
                </div>
            </div>

            <div class="control-group">
                <label class="control-label"></label>
                <div class="controls">
                    <button type="submit" class="btn btn-primary">Modificar</button>
                </div>
            </div>

        </div>
    </form>
</div>

<script type="text/javascript">
    $(document).ready(function() {
        $("#cantidad").focus();
        $(".chosen").chosen();
    });
</script>